import * as React from 'react'; import { View, ViewProps } from '@aws-amplify/ui-react'; import { Demo } from '@/components/Demo'; import { getPropString } from '../utils/getPropString'; import { useViewProps } from './useViewProps'; import { ViewPropControls } from './ViewPropControls'; import { demoState } from '@/utils/demoState'; const propsToCode = (props: ViewProps) => { return ( ` alert('🏔 What a beautiful ! 🔭')} > {"I\'m a <${props.as}>! 🤩"} ` ); }; const defaultViewProps = { as: 'div', ariaLabel: 'View example', width: '20rem', maxWidth: '100%', height: '4rem', color: 'var(--amplify-colors-blue-60)', backgroundColor: 'var(--amplify-colors-white)', boxShadow: '3px 3px 5px 6px var(--amplify-colors-neutral-60)', padding: '1rem', border: '1px solid var(--amplify-colors-black)', borderRadius: '6px', }; export const ViewDemo = () => { const props = useViewProps( demoState.get(View.displayName) || defaultViewProps ); const { ariaLabel, as, backgroundColor, borderRadius, boxShadow, border, color, height, maxWidth, padding, width, } = props; return ( } > alert('🏔 What a beautiful ! 🔭')} padding={padding} width={width} > {`I'm a <${as.toString()}>! 🤩`} ); };